package com.education.welco.controller;


import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.education.common.utils.ApiReturnObject;
import com.education.welco.pojo.LShare;
import com.education.welco.service.LShareService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/lshare")
public class LshareController {

    @Autowired
    private LShareService lShareService;

    @GetMapping("/selectList")
    public ApiReturnObject selectList(Integer pageNum, Integer pageSize,LShare lShare) {
        if (pageNum != null && pageSize != null){
            PageHelper.startPage(pageNum,pageSize);
        }
        List<LShare> lShares = lShareService.selectLShareList(lShare);
        PageInfo<LShare> info = new PageInfo<>(lShares);
        return new ApiReturnObject("200", "查询成功", info);
    }
}
